home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS Vuser Deluxe 2003 October
/
DOS Vuser Deluxe 2003 Oct - Disc 1.iso
/
SKIN
/
Le Crapouillot.wmz
/
Crapouillot.js
< prev
next >
Wrap
Text File
|
2002-02-02
|
5KB
|
237 lines
var geckosState=2;
var visState=0;
var isOpen=false;
var init2do=true;
var vidIsFullscreen=false;
function init(){
pl.setColumnResizeMode(0, "Stretches");
pl.setColumnResizeMode(1, "AutoSizeData");
visState=theme.loadPreference("visState");
if (visState==0 || visState=="--") {
visState=1;
} else {
visState=0;
}
visOnOff();
geckosState=theme.loadPreference("geckosState");
if (geckosState=="--") {
geckosState=1;
} else {
geckosState=geckosState-1;
}
switchGeckos();
onPlayStateChange();
}
function init2(){
if(init2do) {
//this runs only when not in the skin select mode, and only once
init2do=false;
position_slider.visible=true;
position_sliderline.visible=true;
}
}
function switchGeckos(){
geckosState++;
printToDebug(geckosState);
if (geckosState==4) {
geckosState=0;
} else
if (geckosState==0) {
setHidden();
} else
if (geckosState==1) {
setNervous();
} else
if (geckosState==2) {
setCool();
} else
if (geckosState==3) {
setSteady();
}
}
function setHidden(){
geckosState=0;
theme.closeView("walkinggeckos");
printToDebug("Geckos stay hidden for now");
geckoButton.upToolTip="Geckos stay hidden for now, Crapouillot stays quiet";
hideButton.down= "true";
nervousButton.down= "false";
coolButton.down= "false";
steadyButton.down= "false";
}
function setNervous(){
geckosState=1;
theme.openView("walkinggeckos");
geckoButton.upToolTip="Geckos and Crapouillot are active";
hideButton.down= "false";
nervousButton.down= "true";
coolButton.down= "false";
steadyButton.down= "false";
}
function setCool(){
geckosState=2;
theme.openView("walkinggeckos");
geckoButton.upToolTip="Geckos are active, Crapouillot is cool";
hideButton.down= "false";
nervousButton.down= "false";
coolButton.down= "true";
steadyButton.down= "false";
}
function setSteady() {
geckosState=3;
theme.closeView("walkinggeckos");
geckoButton.upToolTip="Geckos are hidden, Crapouillot is cool";
hideButton.down= "false";
nervousButton.down= "false";
coolButton.down= "false";
steadyButton.down= "true";
}
function visOnOff(){
if (visState==0) {
visState=1;
effectsVis.visible=true;
metadata.top=173;
tracktime.top=161;
tracktime.foregroundColor="#BB8844";
position_slider.top=183;
position_sliderline.top=185;
} else {
visState=0;
effectsVis.visible=false;
metadata.top=114;
tracktime.top=102;
tracktime.foregroundColor="#330000";
position_slider.top=124;
position_sliderline.top=126;
}
}
function PlayPause(){
if (player.playState==3) {
player.controls.pause();
} else {
player.controls.play();
}
}
function onPlayStateChange() {
vidIsPlaying = (player.OpenState == osMediaOpen) && (player.currentMedia.ImageSourceWidth>0);
vidIsPlaying ? openVidWindow() : noshowVideo();
}
function openVidWindow() {
theme.openview( 'videoView' );
gearStatusOff();
}
function noshowVideo() {
vidIsPlaying = false;
gears.visible = true;
starStatus = 3;
}
function OnLoadVideo()
{
SnapToVideo();
}
// makes sure that the video stretches along with your resizing == this could be
// done within the <video/> tags...
function AllowResizeVideo()
{
mediacenter.videoStretchToFit=true;
mediacenter.videoShrinkToFit=true;
return;
}
function exitFullmode(){
if (event.keyCode!=27) return;
if(vidIsFullscreen) ZoomVideo();
}
// zooms your video window onClick
function ZoomVideo()
{
g_fUserHasSized = true;
mediacenter.videoStretchToFit = false;
mediacenter.videoShrinkToFit = false;
if( mediacenter.videoZoom < 51 )
{
mediacenter.videoZoom = 100;
}
else if( mediacenter.videoZoom < 101 )
{
mediacenter.videoZoom = 200;
}
else if( (mediacenter.videoZoom < 201) && !vidIsFullscreen )
{
mediacenter.videoStretchToFit = true;
VideoRgn.left=0;
VideoRgn.top=0;
view.maximize();
VideoRgn.width=view.width;
VideoRgn.height=view.height;
vidIsFullscreen=true;
position_sliderline.visible=false;
}
else if( vidIsFullscreen)
{
view.restore();
VideoRgn.left="27";
VideoRgn.top="9";
VideoRgn.width=view.width-37;
VideoRgn.height=view.height-36;
vidIsFullscreen=false;
mediacenter.videoZoom = 201;
position_sliderline.visible=true;
}
else
{
mediacenter.videoZoom = 50;
}
SnapToVideo();
}
// resizes the window to the video width & height
function SnapToVideo()
{
if (vidIsFullscreen) return;
if( (!g_fUserHasSized && mediacenter.videoStretchToFit) || !mediacenter.videoStretchToFit)
{
var zoom = mediacenter.videoStretchToFit ? 100 : mediacenter.videoZoom;
var x = (player.currentMedia.imageSourceWidth * (zoom / 100.0));
var y = (player.currentMedia.imageSourceHeight * (zoom / 100.0));
g_fExpectingSizeChange = true;
view.width = x + 12;
view.height = y + 19;
g_fExpectingSizeChange = false;
}
else
{
view.height= player.currentMedia.imageSourceHeight + 44;
view.width= player.currentMedia.imageSourceWidth + 110;
}
vidinfo.value = "Zoom: " + mediacenter.videoZoom + "%";
}
function OnCloseVideo()
{
video.close();
}